<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page trimDirectiveWhitespaces="true" %>
<%@ page session="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<%@ page trimDirectiveWhitespaces="true" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

<title>首页</title>

<link rel="stylesheet" href="${pageContext.request.contextPath }/css/reset1.css" type="text/css">
<link rel="stylesheet" href="${pageContext.request.contextPath }/css/index.css" type="text/css">

<link rel="stylesheet" href="${pageContext.request.contextPath }/css/bootstrap.min.css" type="text/css" />

<script src="${pageContext.request.contextPath }/js/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/js/bootstrap.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/js/indexseo.js" ></script>


<script src="${pageContext.request.contextPath }/js/slider.js"></script>
<script src="${pageContext.request.contextPath }/js/navChange.js"></script>

<script type="text/javascript" src="${pageContext.request.contextPath }/js/jquery.cookie.js"></script>
<script type="text/javascript">
var E3MALL = {
		checkLogin : function(){
			var _ticket = $.cookie("token");
			if(!_ticket){
				return ;
			}
			$.ajax({
				url : "${pageContext.request.contextPath }/user/token/" + _ticket,
				dataType : "jsonp",
				type : "GET",
				success : function(data){
					if(data.status == 200){
						var username = data.data.username;
						/* alert("hello"+username); */
						/* var html = username + "，欢迎您！<a href=\"http://www.e3mall.cn/user/logout.html\" class=\"link-logout\">[退出]</a>"; */
						var html = "<div class='navbar-right' style='display: inline-block;padding-top: 10px;'>"+
				          "<div class=''>"+
				          	"<ol class='list-inline'>"+
				          		"<li>欢迎您,<font style='color: red;'>"+username+"</font></li>|"+
				          		"<li><a href='${pageContext.request.contextPath}/user/logout/"+_ticket+"' class='link-logout'>[退出]</a></li>"+
				          	"</ol>"+
				          "</div>"+
				          "</div>";
						$("#loginbar").html(html);
					}
				}
			});
		}
	}

	$(function(){
		// 查看是否已经登录，如果已经登录查询登录信息
		E3MALL.checkLogin();
	});
</script>


 <style>
  /* Make the image fully responsive */
 .carousel-inner img {
      width:100%;
      height:100%;
  }
  </style>
</head>

<body style="overflow-x:hidden">

    <jsp:include page="/WEB-INF/jsp/head.jsp"/>


  <div class="container" style="padding-top: 0px; margin-top: 0px; height: auto;">
  	 <!--轮播图-->
	  <!--<div class="container-fluid">-->
		  	<div class="row" style="padding-left: 100px;">
						<!--<div class="col-lg-6" style="padding-top: 5px;">
					    <span style="display: inline-block;">失物招领</span>
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						&nbsp;
						<span style="display: inline-block;"><a href=""><font>更多>></font></a></span>
						
						</div>-->
						
					<div class="col-sm-4">
								<span>失物招领</span>
							</div>
							<div class="col-sm-1">
								<a href="${pageContext.request.contextPath }/lost/LostLost" target="_self"><span>更多>></span></a>
							</div>		
			</div>
			
	    <div class="row" style="padding-top: 0px;">
	    	<!--轮播图-->
		  <div class="col-sm-6 col-sm-offset-1" style="padding-top: 10px;height: 356px;">
		  	
						<div id="myCarousel" class="carousel slide">
							<!-- 轮播（Carousel）指标 -->
							<ol class="carousel-indicators">
							 <c:forEach items="${lostLunBo }" varStatus="vs">
								<li data-target="#myCarousel" data-slide-to="${vs.index }" class="<c:if test="${vs.index==0 }">active</c:if>"></li>
							</c:forEach>
							</ol>
							
							<!-- 轮播（Carousel）项目 -->
							<div class="carousel-inner">
							
							<c:forEach var="LuBo" items="${lostLunBo }" varStatus="vs">
								<div class="item <c:if test="${vs.index==0 }">active</c:if>">
									<a href="${pageContext.request.contextPath }/lost/lostInfo?id=${LuBo.id}"><img src="${LuBo.lostimage}" class="img-responsive" style="height: 285px;width: 695px;" alt="First slide"></a>
									<div class="carousel-caption">${LuBo.lostname}</div>
								</div>
								</c:forEach>
								
							</div>
							<!-- 轮播（Carousel）导航 -->
							<a class="left carousel-control" href="#myCarousel" role="button" data-slide="prev">
								<span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
								<span class="sr-only">Previous</span>
							</a>
							<a class="right carousel-control" href="#myCarousel" role="button" data-slide="next">
								<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
								<span class="sr-only">Next</span>
							</a>
						</div>
		     </div>

			<div class="col-sm-4">
				<!--热点新闻-->
				<div class="row">
					<div class="col-sm-9">
								<span>热点新闻</span>
							</div>
							<div class="col-sm-3">
								<a href="${pageContext.request.contextPath }/index/HotNews" target="_self"><span>更多>></span></a>
							</div>
					<hr />
				</div>
				
				<div class="row">
					<div class="col-sm-12">
					<c:forEach var="hotn" items="${hotnews }">
						<div class="row">
							<div class="col-sm-9">
								<a href="${pageContext.request.contextPath }/news/NewsInfo?id=${hotn.id}" target="_self">${hotn.title }</a>
							</div>
							<div class="col-sm-3">
								<span>${hotn.created }</span>
							</div>
						</div>
						</c:forEach>
							    
				</div>
						
						
				</div>
				
				<!--普通新闻-->
				<div class="row" style="padding-top: 10px;">
					<div class="col-sm-9">
							<span>咨询</span>
							</div>
							<div class="col-sm-3">
								<a href="${pageContext.request.contextPath }/index/NormalNews" target="_self"><span>更多>></span></a>
							</div>
						<hr />
				</div>
				
				<div class="row">
					<!--<div class="col-sm-12">
							    <ul class="">
							  	<li><a href="复制 shouye.html" target="_self">今日头条     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span>2020-12-12</span></a></li>
							  	<li><a href="复制 shouye.html" target="_self">今日头条      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span>2020-12-12</span></a></li>
							  	<li><a href="复制 shouye.html" target="_self">今日头条      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span>2020-12-12</span></a></li>
							  	<li><a href="复制 shouye.html" target="_self">今日头条      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span>2020-12-12</span></a></li>
							  	<li><a href="复制 shouye.html" target="_self">今日头条      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span>2020-12-12</span></a></li>
							  	<li><a href="复制 shouye.html" target="_self">今日头条      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span>2020-12-12</span></a></li>
							  	<li><a href="复制 shouye.html" target="_self">今日头条      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span>2020-12-12</span></a></li>
							  	<li><a href="复制 shouye.html" target="_self">今日头条      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span>2020-12-12</span></a></li>
							  </ul>
						</div>-->
						<div class="col-sm-12">
							<c:forEach var="normal" items="${normalList }">
						<div class="row">
						
							<div class="col-sm-9">
								<a href="${pageContext.request.contextPath }/news/NewsInfo?id=${normal.id}" target="_self">${normal.title }</a>
							</div>
							<div class="col-sm-3">
								<span>${normal.created }</span>
							</div>
						</div>
						</c:forEach>
							    
				</div>
						
				</div>
			
				</div>
		</div>
   <!--</div>-->
   </div>
   </div>
   
   
		<div class="" style="margin: auto;"></div>
		<!--底层-->
		<nav class="navbar-fixed-bottom">
			<header class="header" style="background-color: gainsboro">
		      <div class="container1">
		      	
		        <ul class="nav" style="padding-top: 5px;">
		          <li class="nav" style="display: inline;">
		            <p>CopyRight@201624131105</p>
		          </li>
		        </ul>
		        
		      </div>
		    </header>
		    </nav>

<%-- <script type="text/javascript">
function logout() {
	alert("ello");
	var ticket = $.cookie("token");
	if(!ticket){
		return ;
	}
	$.post(
		"<%=basePath%>user/logout",
		{"token":ticket},
		function (data) {
			window.location.reload();
		}
	);
}
</script> --%>
</body>
</html>